<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript" src="<%=basePath %>js/ckeditor/ckeditor.js"></script>
<title>添加属性</title>
<script type="text/javascript">
</script>
<style type="text/css">
.tr{
width: 515px;
height: 40px;
}
.td1{
width: 100px;
height: 40px;
float: left;
}
.td2{
width: 200px;
height: 40px;
float: left;
}
.td3{
width: 140px;
height: 40px;
float: left;
}
.span{
color: red;
}

#province{
width: 80px;
height: 25px;
}
#citys{
width: 80px;
height: 25px;
}
#countys{
width: 80px;
height: 25px;
}
#streets{
width: 80px;
height: 25px;
}

</style>
</head>
<body>
<div style="width:550px;height: 380px;margin: 0px auto;background-color: #f0e68c">
<form action="attr_saveAttr" method="post" id="save">
<s:hidden name="attr.attrId" value="%{attr.attrId}"></s:hidden>
<s:hidden id="subId" value="%{subId}"></s:hidden>
<s:hidden id="type" value="%{attr.attrType}"></s:hidden>
<div class="tr" >
<div class="td1" align="right"><span>小类:</span></div>
<div class="td2" ><s:select name="subId" id="sub" list="subTypes"  listKey="subId" listValue="subName" ></s:select></div>
<div class="td3"><span class="span">*</span></div>
</div>
<div class="tr">
<div class="td1" align="right"><span>属性名称：</span></div>
<div class="td2"><s:textfield  name="attr.attrName" required="true"  id=""  placeholder=""  value="%{attr.attrName}" ></s:textfield></div>
<div class="td3"><span class="span" id="nameError">*</span></div>
</div>
<div class="tr">
<div class="td1" align="right"><span>属性值：</span></div>
<div class="td2" ><s:textfield  name="attr.attrValue" required="true"  id="attrType"  placeholder=""  value="%{attr.attrValue}"></s:textfield></div>
<div class="td3"><span class="span">*</span></div>
</div>
<div class="tr">
<div class="td1" align="right"><span>属性类型：</span></div>
<div class="td2" ><s:select name="attr.attrType" list="#{1:'属性1',2:'属性2'}" listKey="key" listValue="value" ></s:select></div>
<div class="td3"><span class="span">*</span></div>
</div>
</form>
</div>
<script type="text/javascript">
var subId=$("#subId").val();
$("#sub option[value="+subId+"]").attr("selected",true);
var type=$("#type").val();
$("#attrType option[value="+type+"]").attr("selected",true);
</script>
</body>
</html>